.class Les/te0;
.super Les/re0;
.source "OBEXServerOperationPut.java"

# interfaces
.implements Les/qe0;
.implements Les/ne0;


# direct methods
.method protected constructor <init>(Les/ue0;Les/le0;Z)V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-direct {p0, p1, p2}, Les/re0;-><init>(Les/ue0;Les/le0;)V

    .line 2
    new-instance p1, Les/oe0;

    invoke-direct {p1, p0}, Les/oe0;-><init>(Les/me0;)V

    iput-object p1, p0, Les/re0;->j:Les/oe0;

    .line 3
    invoke-virtual {p0, p2, p3}, Les/re0;->a(Les/tp0;Z)V

    return-void
.end method

.method private j()V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x1

    .line 1
    iput-boolean v0, p0, Les/re0;->e:Z

    .line 2
    iget-object v0, p0, Les/re0;->a:Les/ue0;

    const/16 v1, 0xa0

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Les/ve0;->a(ILes/le0;)V

    .line 3
    invoke-virtual {p0}, Les/te0;->close()V

    .line 4
    new-instance v0, Ljava/io/IOException;

    const-string v1, "Operation aborted by client"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0
.end method


# virtual methods
.method public a()Ljava/io/InputStream;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-boolean v0, p0, Les/re0;->d:Z

    if-nez v0, :cond_1

    .line 2
    iget-boolean v0, p0, Les/re0;->k:Z

    if-nez v0, :cond_0

    const-string v0, "openInputStream"

    .line 3
    invoke-static {v0}, Les/be0;->a(Ljava/lang/String;)V

    const/4 v0, 0x1

    .line 4
    iput-boolean v0, p0, Les/re0;->k:Z

    .line 5
    iget-object v0, p0, Les/re0;->j:Les/oe0;

    return-object v0

    .line 6
    :cond_0
    new-instance v0, Ljava/io/IOException;

    const-string v1, "input stream already open"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 7
    :cond_1
    new-instance v0, Ljava/io/IOException;

    const-string v1, "operation closed"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public a(Les/oe0;)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 8
    iget-boolean v0, p0, Les/re0;->f:Z

    const/4 v1, 0x0

    if-nez v0, :cond_1

    iget-boolean v0, p0, Les/re0;->h:Z

    if-eqz v0, :cond_0

    goto :goto_0

    :cond_0
    const-string p1, "server operation reply continue"

    .line 9
    invoke-static {p1}, Les/be0;->a(Ljava/lang/String;)V

    .line 10
    iget-object p1, p0, Les/re0;->a:Les/ue0;

    const/16 v0, 0x90

    iget-object v2, p0, Les/re0;->c:Les/le0;

    invoke-virtual {p1, v0, v2}, Les/ve0;->a(ILes/le0;)V

    .line 11
    iput-object v1, p0, Les/re0;->c:Les/le0;

    .line 12
    invoke-virtual {p0}, Les/te0;->i()Z

    return-void

    :cond_1
    :goto_0
    const/4 v0, 0x1

    .line 13
    invoke-virtual {p1, v1, v0}, Les/oe0;->a([BZ)V

    return-void
.end method

.method public a(Z[B)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 14
    iget-object v0, p0, Les/re0;->a:Les/ue0;

    iget-boolean v0, v0, Les/ve0;->l:Z

    if-eqz v0, :cond_1

    .line 15
    invoke-virtual {p0}, Les/te0;->i()Z

    .line 16
    iget-object v0, p0, Les/re0;->a:Les/ue0;

    iget-boolean v0, v0, Les/ve0;->l:Z

    if-nez v0, :cond_0

    goto :goto_0

    .line 17
    :cond_0
    new-instance p1, Ljava/io/IOException;

    const-string p2, "Client not requesting data"

    invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 18
    :cond_1
    :goto_0
    invoke-static {}, Les/ve0;->l()Les/le0;

    move-result-object v0

    const/16 v1, 0x90

    const/16 v2, 0x48

    if-eqz p1, :cond_2

    const/16 v2, 0x49

    .line 19
    :cond_2
    invoke-virtual {v0, v2, p2}, Les/le0;->a(ILjava/lang/Object;)V

    .line 20
    iget-object p1, p0, Les/re0;->c:Les/le0;

    if-eqz p1, :cond_3

    .line 21
    invoke-static {v0, p1}, Les/le0;->a(Les/tp0;Les/tp0;)Les/tp0;

    const/4 p1, 0x0

    .line 22
    iput-object p1, p0, Les/re0;->c:Les/le0;

    .line 23
    :cond_3
    iget-object p1, p0, Les/re0;->a:Les/ue0;

    invoke-virtual {p1, v1, v0}, Les/ve0;->a(ILes/le0;)V

    .line 24
    invoke-virtual {p0}, Les/te0;->i()Z

    return-void
.end method

.method public close()V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const-string v0, "server close put operation"

    .line 1
    invoke-static {v0}, Les/be0;->a(Ljava/lang/String;)V

    .line 2
    iget-object v0, p0, Les/re0;->j:Les/oe0;

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    .line 3
    invoke-virtual {v0}, Les/oe0;->close()V

    .line 4
    iput-object v1, p0, Les/re0;->j:Les/oe0;

    .line 5
    :cond_0
    iget-object v0, p0, Les/re0;->i:Les/pe0;

    if-eqz v0, :cond_1

    .line 6
    invoke-virtual {v0}, Les/pe0;->close()V

    .line 7
    iput-object v1, p0, Les/re0;->i:Les/pe0;

    .line 8
    :cond_1
    invoke-super {p0}, Les/re0;->close()V

    return-void
.end method

.method public h()Ljava/io/OutputStream;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-boolean v0, p0, Les/re0;->d:Z

    if-nez v0, :cond_1

    .line 2
    iget-object v0, p0, Les/re0;->i:Les/pe0;

    if-nez v0, :cond_0

    .line 3
    new-instance v0, Les/pe0;

    iget-object v1, p0, Les/re0;->a:Les/ue0;

    iget v1, v1, Les/ve0;->f:I

    invoke-direct {v0, v1, p0}, Les/pe0;-><init>(ILes/ne0;)V

    iput-object v0, p0, Les/re0;->i:Les/pe0;

    return-object v0

    .line 4
    :cond_0
    new-instance v0, Ljava/io/IOException;

    const-string v1, "output stream already open"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 5
    :cond_1
    new-instance v0, Ljava/io/IOException;

    const-string v1, "operation closed"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method protected i()Z
    .locals 8
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/re0;->a:Les/ue0;

    invoke-virtual {v0}, Les/ve0;->j()[B

    move-result-object v0

    const/4 v1, 0x0

    .line 2
    aget-byte v2, v0, v1

    const/16 v3, 0xff

    and-int/2addr v2, v3

    and-int/lit16 v4, v2, 0x80

    const/4 v5, 0x1

    if-eqz v4, :cond_0

    const/4 v4, 0x1

    goto :goto_0

    :cond_0
    const/4 v4, 0x0

    :goto_0
    if-eqz v4, :cond_1

    const-string v6, "server operation got final packet"

    .line 3
    invoke-static {v6}, Les/be0;->a(Ljava/lang/String;)V

    .line 4
    iput-boolean v5, p0, Les/re0;->f:Z

    :cond_1
    const/4 v6, 0x2

    const/4 v7, 0x0

    if-eq v2, v6, :cond_3

    const/16 v6, 0x82

    if-eq v2, v6, :cond_3

    if-eq v2, v3, :cond_2

    .line 5
    iput-boolean v5, p0, Les/re0;->h:Z

    .line 6
    invoke-static {v2}, Les/xe0;->c(I)Ljava/lang/String;

    move-result-object v0

    int-to-long v1, v2

    const-string v3, "server operation invalid request"

    invoke-static {v3, v0, v1, v2}, Les/be0;->a(Ljava/lang/String;Ljava/lang/String;J)V

    .line 7
    iget-object v0, p0, Les/re0;->a:Les/ue0;

    const/16 v1, 0xc0

    invoke-virtual {v0, v1, v7}, Les/ve0;->a(ILes/le0;)V

    goto :goto_1

    .line 8
    :cond_2
    invoke-direct {p0}, Les/te0;->j()V

    throw v7

    .line 9
    :cond_3
    aget-byte v1, v0, v1

    const/4 v2, 0x3

    invoke-static {v1, v0, v2}, Les/le0;->a(B[BI)Les/le0;

    move-result-object v0

    .line 10
    iget-object v1, p0, Les/re0;->a:Les/ue0;

    invoke-virtual {v1, v0}, Les/ue0;->a(Les/le0;)Z

    move-result v1

    if-nez v1, :cond_4

    .line 11
    iput-boolean v5, p0, Les/re0;->h:Z

    .line 12
    iget-object v0, p0, Les/re0;->a:Les/ue0;

    const/16 v1, 0xc1

    invoke-virtual {v0, v1, v7}, Les/ve0;->a(ILes/le0;)V

    goto :goto_1

    .line 13
    :cond_4
    iget-object v1, p0, Les/re0;->b:Les/tp0;

    invoke-static {v1, v0}, Les/le0;->a(Les/tp0;Les/tp0;)Les/tp0;

    .line 14
    invoke-virtual {p0, v0, v4}, Les/re0;->a(Les/tp0;Z)V

    :goto_1
    return v4
.end method
